#include "gamescore.h"
#include "ui_gamescore.h"

GameScore::GameScore(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::GameScore)
{
    ui->setupUi(this);
}

GameScore::~GameScore()
{
    delete ui;
}

void GameScore::setItem(const QString &score)
{
    ui->listWidget->addItem(score);
}

void GameScore::on_pushButton_clicked()
{
    ui->listWidget->clear();
    QFile file("D:/GreedySnake/Snake/his_score.txt");
    int ret=file.open(QIODevice::WriteOnly);
    if(ret==false)
        exit(-1);
    file.close();
}

void GameScore::on_pushButton_2_clicked()
{
    this->close();
//    GameSelect *gameselect=new GameSelect;
//    gameselect->show();
}
